<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>注册(3/3)</title>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/app.css" />
		<style type="text/css">
			.mui-input-row .mui-icon-clear {
				position: initial !important;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav" style="background: #0072DC;">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"><span style="font-size: 15px;color: #FFFFFF;vertical-align: 2px;">返回</span></a>
			<h1 class="mui-title text_title" id="title">注册(3/3)</h1>
		</header>
		<div class="mui-content">
			<div class="mui-text-left main-top-margin main-content-container" style="padding-left: 15px;margin-top: 40px;">
				<p>请设置登录密码，必须为6~16位的数字或字母</p>
			</div>
			<form class="mui-input-group">
				<div class="mui-input-row" style="margin-top: 35px;vertical-align: center;">
					<input id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入密码">
				</div>
				<div class="mui-input-row">
					<input id='password2' type="password" class="mui-input-clear mui-input" placeholder="请确认密码">
				</div>
			</form>
			<div class="mui-content-padded " style="margin-top: 35px;">
				<button id='go' class="mui-btn main-btn-block"><span style="color: #FFFFFF;font-size: 18px;">提交</span></button>
			</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
			mui.init();
			mui.plusReady(function () {
				var current = plus.webview.currentWebview();
				var code=current.code;
				var tel=current.tel;
				var srcwb=current.srcwb;
				
				document.getElementById("go").addEventListener('tap',function () {
					var psw=document.getElementById("password").value;
					var psw2=document.getElementById("password2").value;
					if(!psw){
						plus.nativeUI.toast('请填写密码');
						return;
					}
					if(psw!==psw){
						plus.nativeUI.toast('两次密码不一致');
						return;
					}
					
					user.setpwd(tel,psw,'Reg',function () {
						// 通知来源页刷新信息(可能是个人中心、订单中心等), reload中需要自己显示
						mui.fire(plus.webview.getWebviewById(srcwb),'reload',{show:true});
					});
				});
				
				showPage(current);
			});
		</script>
	</body>

</html>